package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiD_reward;

//DAO
public interface D_rewardMapperBase {

	// 根据id查看
	@Select("SELECT * FROM d_reward  WHERE REWARDID = #{rewardid}")
	public ApiD_reward findD_rewardById(Integer rewardid);

	// 查看数据集
	@Select("SELECT * FROM D_reward")
	public List<ApiD_reward> findD_rewards();

	// 根据条件查看数据集
	public List<Map<String, Object>> findD_rewardsByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO d_reward (PROXYID, MINMONEY, MAXMONEY, PERCENT, SORT) VALUES (#{proxyid}, #{minmoney}, #{maxmoney}, #{percent}, #{sort})")
	@Options(useGeneratedKeys = true, keyProperty = "rewardid")
	public int insertD_reward(ApiD_reward d_reward);

	// 修改
	@Update("UPDATE d_reward SET PROXYID = #{proxyid}, MINMONEY = #{minmoney}, MAXMONEY = #{maxmoney}, PERCENT = #{percent}, SORT = #{sort} WHERE REWARDID = #{rewardid}")
	public int updateD_reward(ApiD_reward d_reward);

	// 删除
	@Delete("DELETE FROM d_reward  WHERE REWARDID = #{rewardid}")
	public int deleteD_reward(Integer rewardid);

	// Foreign keys revelant

	// region Indexs revelant

}
